function EnabledBtns(bEnabled)
{
        parent.frames("newButtonFrm").document.getElementById("btnCheck").disabled=1-bEnabled;
        parent.frames("newButtonFrm").document.getElementById("btnAdd").disabled=0;
        parent.frames("newButtonFrm").document.getElementById("btnReset").disabled=bEnabled;
        parent.frames("newButtonFrm").document.getElementById("btnDelete").disabled=bEnabled;
}

function add(){
	parent.frame1.cols="*,110";
	parent.frame2.cols="*,50%";
	parent.frame3.rows="120,30%,*";
	parent.frames("upFrm").navigate("studentquery.jsp");
	parent.frames("fistFrm").navigate("../../MoralSpecialityForRp.list?dbgrid=MoralSpecialityForRp");
	parent.frames("secondFrm").navigate("../../CheckMoralClassForRp.list?dbgrid=CheckMoralClassForRp");
	parent.frames("newButtonFrm").navigate("newButton.jsp");
	parent.frames("thirdFrm").navigate("../../StudentListForRp.list?dbgrid=StudentListForRp&classid=-11");
	parent.frames("forthFrm").navigate("../../MoralStudentRpItem.list?dbgrid=MoralStudentRpItem&studentId=-11");
}

function single(){
	parent.frame1.cols="*,110";
	parent.frame2.cols="*,50%";
	parent.frame3.rows="120,30%,*";
	parent.frames("upFrm").navigate("studentquery.jsp");
	parent.frames("fistFrm").navigate("../../MoralSpecialityForRp.list?dbgrid=MoralSpecialityForRp");
	parent.frames("secondFrm").navigate("../../CheckMoralClassForRp.list?dbgrid=CheckMoralClassForRp");
	parent.frames("newButtonFrm").document.getElementById("btnGroup").disabled=0;
	parent.frames("newButtonFrm").document.getElementById("btnSingle").disabled=1;
	parent.frames("thirdFrm").navigate("../../StudentListForRp.list?dbgrid=StudentListForRp&classid=-11");
	parent.frames("forthFrm").navigate("../../MoralStudentRpItem.list?dbgrid=MoralStudentRpItem&studentId=-11");
}
function group(){
	parent.frames("upFrm").navigate("rpSelect.jsp");
	parent.frames("newButtonFrm").document.getElementById("btnGroup").disabled=1;
	parent.frames("newButtonFrm").document.getElementById("btnSingle").disabled=0;
	parent.frames("fistFrm").navigate("blank.htm");
	parent.frames("secondFrm").navigate("blank.htm");
	parent.frames("thirdFrm").navigate("blank.htm");
	parent.frames("forthFrm").navigate("blank.htm");
}

function back(){
	parent.frames("appraiseFrm").navigate("../../MoralAppraiseItem.list?dbgrid=MoralAppraiseIndex");
}

function check(){
	    parent.frame1.cols="*,0";
	    parent.frame2.cols="*,0";
	    parent.frame3.rows="150,30%,*"
        parent.frames("upFrm").navigate("check.jsp");
        parent.frames("fistFrm").navigate("../../MoralRewardItem.list?dbgrid=MoralRewardItemCheck");
     	parent.frames("secondFrm").navigate("../../MoralPunishItem.list?dbgrid=MoralPunishItemCheck");
     	parent.frames("thirdFrm").navigate("../../MoralStudentRpInfo.list?dbgrid=MoralStudentRpInfo");
     	parent.frames("forthFrm").navigate("blank.htm");	
}

function getRpResult(){
	rpId=trim(parent.frames("upFrm").document.getElementById("rpId").value);
	setTimeS=trim(parent.frames("upFrm").document.getElementById("setTimeS").value);
	setTimeE=trim(parent.frames("upFrm").document.getElementById("setTimeE").value);
	studentNo=trim(parent.frames("upFrm").document.getElementById("studentNo").value);
		if( !doValidate('studentForm',parent.frames("upFrm").document.forms(0)) )
		{
			return;
		}
    parent.frames("thirdFrm").navigate("../../MoralStudentRpInfo.list?dbgrid=MoralStudentRpInfo&rpId="
		+rpId+"&setTimeS="+setTimeS+"&setTimeE="+setTimeE+"&studentNo="+studentNo);
}

function addStudentRp(){	
	 var url,style,studentId,setTime;
	 style="dialogWidth:24;dialogHeight:20;status:no;help:no";
	 studentId=trim(parent.frames("upFrm").document.getElementById("studentId").value);
	 setTime=trim(parent.frames("upFrm").document.getElementById("setTime").value);
	 url="AddStudentRp/index.jsp?studentId="+studentId+"&setTime="+setTime;
	 window.showModalDialog(url,null,style);
	 parent.frames("forthFrm").window.location.reload(true);
}

function addStudentRpGroup(){
	studentNo=trim(parent.frames("upFrm").document.getElementById("studentNo").value);
	setTime=trim(parent.frames("upFrm").document.getElementById("setTime").value);
	rpId=trim(parent.frames("upFrm").document.getElementById("rpId").value);
	if( !doValidate('RP_studentForm',parent.frames("upFrm").document.forms(0)) )
	{
		return;
	}
	var strURL = "rewardPunishSet.do?method=addRpResultGroup&rpId="+rpId+"&studentNo="+studentNo+"&setTime="+setTime;
	parent.frames("upFrm").navigate(strURL);
	parent.frames("forthFrm").window.location.reload(true);
}

function selectRp(){
	var url,style,setTime,rpId;
	style="dialogWidth:24;dialogHeight:20;status:no;help:no";
	setTime=trim(parent.frames("upFrm").document.getElementById("setTime").value);
	url="SelectRp/index.jsp?setTime="+setTime;
	rpId=window.showModalDialog(url,null,style);
	var strURL = "rewardPunishSet.do?method=selectRp&rpId="+rpId+"&setTime="+setTime;	
	parent.frames("upFrm").navigate(strURL);
	parent.frames("fistFrm").navigate("../../MoralSpecialityForRp.list?dbgrid=MoralSpecialityForRp");
	parent.frames("secondFrm").navigate("../../CheckMoralClassForRp.list?dbgrid=CheckMoralClassForRp");
	parent.frames("thirdFrm").navigate("../../StudentListForRp.list?dbgrid=StudentListForRp&classid=-11");
	parent.frames("forthFrm").navigate("../../MoralStudentRpItem.list?dbgrid=MoralStudentRpItem&studentId=-11");
}

function ok(){
	if( !doValidate('RP_studentForm',parent.frames("upFrm").document.forms(0)) )
	{
		return;
	}
	parent.frame3.rows="150,30%,*";
	parent.frames("upFrm").isSubmitting=true;
	parent.frames("upFrm").document.forms(0).submit();
}
function set(){
	  var url,style,appraiseId;
	  style="dialogWidth:40;dialogHeight:28;status:no;help:no";	 
	  url="SetRewardPunish/index.jsp";
	  window.showModalDialog(url,null,style);	
}

